Page({
    data: {
        show:'content-show',
        dateList: [
            {
                year: '2018',
                month: '2',
                info: [
                    {
                        day: '1',
                        week: '星期二',
                        subject: '文献学'
                    },
                    {
                        day: '2',
                        week: '星期三',
                        subject: '文化学'
                    }
                ]
            },
            {
                year: '2018',
                month: '3',
                info: [
                    {
                        day: '4',
                        week: '星期五',
                        subject: '英语'
                    },
                    {
                        day: '2',
                        week: '星期三',
                        subject: '政治'
                    }
                ]
            }
        ]
    },
    onLoad:function(options){
        var length = this.data.dateList.length;
        var arr = new Array();
        for(var i =0 ; i<length ; i++){
            var data={status:0,show:'content-hidden',imgTag:'../../images/icon/down.png'};
            arr.push(data);
        }
        this.setData({
            allList:arr
        });
    },
    openTags:function(event){
        var index = event.currentTarget.id;
        var status = this.data.allList[index].status;
        var data = 'allList['+index+']';
        if(status === 0){
           this.setData({
                [data]:{status:1,show:'content-show',imgTag:'../../images/icon/up.png'}
           });
        }else{
            this.setData({
                [data]:{status:0,show:'content-hidden',imgTag:'../../images/icon/down.png'}
           });
        }
    }

})